<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../vue.js"></script>
</head>

<body>
  <div id="app">
    <div v-if="EmailOrUser">
      <label for="username">账号登陆:</label>
      <input type="text" placeholder="请输入账号" id="username">
    </div>
    <div v-else>
      <label for="email">邮箱登陆:</label>
      <input type="email" placeholder="请输入邮箱" id="email">
    </div>
    <button @click="changeLogin">切换登陆方式</button>
  </div>
  <script>
    const app = new Vue({
      el: "#app",
      data: {
        EmailOrUser: true
      },
      methods: {
        changeLogin() {
          this.EmailOrUser = !this.EmailOrUser;
        }
      }
    })
  </script>
</body>

</html>